package tum0r.generate_code.database.enums;

import java.util.ArrayList;

/**
 * 生成时间: 2021-05-20 20:17:15
 */
@SuppressWarnings("unused")
public enum NewsFields {
    ID,
    Title,
    Content,
    Time;

    private static ArrayList<NewsFields> all = null;

    public static ArrayList<NewsFields> getAll() {
        if (all == null) {
            all = new ArrayList<>();
            all.add(ID);
            all.add(Title);
            all.add(Content);
            all.add(Time);
        }
        return all;
    }

    public static NewsFields[] getAllArray(){
        return getAll().toArray(new NewsFields[0]);
    }

    public static ArrayList<NewsFields> except(NewsFields... fields) {
        ArrayList<NewsFields> result = new ArrayList<>(getAll());
        if (fields != null && fields.length != 0) {
            for (NewsFields field : fields) {
                result.remove(field);
            }
        }
        return result;
    }
}
